<?php

class DB_TAG extends ORM_Table {
    
    static protected $table_name = 'tag';
    
    static public function getTableName($params = null) {
        return self::$table_name;
    }
    
    static function store($weibo_id, $tag){
        $rs = ORM_Finder::findOne('DB_TAG', array('weibo_id'=>$weibo_id));
        if(!$rs){
            $rs = new DB_TAG();
            $rs->setWeiboId($weibo_id);
            $rs->setTag($tag);
            $rs->save();
        }else{
            $rs->setTag($tag);
            $rs->save();            
        }
        return $rs;
    }
}

?>
